Programming apparatus of a visual inspection program

ABSTRACT

A programming apparatus supports a user to program a visual inspection program used in a visual inspection apparatus. A plurality of standard inspection flows corresponding to kinds of products to be inspected, a plurality of image processing algorithms and a plurality of inspection parameters used in the visual inspection of the product are previously memorized. The user prepares a plurality of image data of defective units and non-defective units of the product which he wishes to inspect, and programs a provisional visual inspection program configured by the standard inspection flow corresponding to the kind of the product which is selected by the user, the image processing algorithms and the inspection parameters selected by following a guidance of the standard inspection flow. The provisional visual inspection program is evaluated by using the sample image data whether it is proper or improper for inspecting the product.

TECHNICAL FIELD

The present invention relates to an apparatus for programming a visualinspection program used in a visual inspection apparatus for inspectingan appearance of a product conveyed on a manufacturing line thereof.

BACKGROUND ART

Conventionally, a visual inspection apparatus is used for inspecting anappearance of a product in a manufacturing processes. In theconventional visual inspection apparatus, a visual image of anappearance of a product is taken by a camera using an image acquisitiondevice such as a CCD (Charge Coupled device), and an image datacorresponding to the visual image of the product outputted from thecamera is processed by following a predetermined visual inspectionprogram so that it is judged whether the appearance of the productsatisfies a predetermined quality or not.

Prior to the actual visual inspection of the products, the visualinspection program and the parameters are adjusted in a manner so thatthe appearance of the products are precisely judged as defective ornon-defective by using sample image data of defective units andnon-defective units which are previously prepared by a user of thevisual inspection apparatus.

There are infinite varieties in the products to be inspected, so thatinspection items, inspection methods, and inspection parameters cannotbe standardized. Thus, the visual inspection program generally has anexclusive use with respect to each product to be inspected. When thekind of the product to be inspected is changed, it is necessary toprepare a new exclusive visual inspection program suitable forinspecting the new product. Furthermore, it demands an expert knowledgewith respect to a computer such as the C-language to program the visualinspection program, so that the visual inspection program is generallyprogrammed by a programmer in a vendor of the visual inspectionapparatus.

On the other hand, the Publication Gazette of Unexamined Japanese PatentApplication Sho 63-191278 shows a conventional user support method in aninteractive image processing system by which the user unaccustomed tothe image processing algorithm can easily execute the image processing.In the interactive image processing system, the know-how of an expert inthe art of the image processing with respect to the usage or theoperational specification of the image processing algorithms ismemorized in a memory. When the user is required to select asub-function of the image processing or to set a parameter while theimage processing algorithm is executed, the user is supported bydisplaying the explanation of judging standard for selecting thesub-function or the parameter on a monitor display, or supported byautomatically selecting the sub-function or the parameter by using theknow-how of the expert in the memory.

The conventional user support method can support the user exactly forselecting the most suitable sub-function or parameter in the imageprocessing. It, however, is difficult to support the user of the visualinspection apparatus for programming the visual inspection programeasily, even when the conventional user support method is applied to themethod for forming the visual inspection program. Since the visualinspection program has substantially the exclusive use with respect tothe product to be inspected, the know-how of the expert can only beapplied to a specific case. Thus, it is substantially impossible thatthe user unaccustomed to the expert knowledge of the computer can easilyprogram the visual inspection program suitable for the visual inspectionof the desired product.

Furthermore, when the product to be inspected is changed, the image datato be processed in the visual inspection program will be different atall. If the inspection parameters used in the visual inspection programare not based on the actual image data of the product to be inspected,the reliability and the precision of the visual inspection will bereduced. Still furthermore, if the inspection result by the imageprocessing steps in the visual inspection are not previously confirmed,the results of the visual inspection becomes unreliable.

DISCLOSURE OF INVENTION

An objective of the present invention is to provide a programmingapparatus of a visual inspection program used in a visual inspectionapparatus, by which the user of the visual inspection apparatus caneasily program the visual inspection program suitable for an object (ora product) to be inspected. Another objective of the present inventionis to provide a visual inspection apparatus by which the reliable andprecise visual inspection suitable for inspecting the object can beexecuted. Still another objective of the present invention is to providea method for programming a visual inspection program by which the userof the visual inspection apparatus can easily program the visualinspection program suitable for the object to be inspected. Stillanother objective of the present invention is to provide a program forprogramming the visual inspection program, which can be installed into aknown personal computer so that the known personal computer can serve asthe programming apparatus of the visual inspection program. Stillanother objective of the present invention is to provide a recordingmedium memorizing the program for programming the visual inspectionprogram.

A programming apparatus of a visual inspection program in accordancewith the present invention comprises: an image data memory formemorizing a plurality of sample image data of defective units andnon-defective units of an object to be inspected which are previouslyprepared by a user; an algorithm memory for memorizing a plurality ofimage processing algorithms with respect to each inspection item; astandard flow memory for memorizing at least one standard inspectionflow and a plurality of inspection parameters with respect to each kindof object to be inspected; a display unit having a monitor display fordisplaying at least a guidance of a programming steps; an input unit bywhich a user inputs or selects a kind of an object which he wishes toinspect, selects at least one image processing algorithm and at leastone inspection parameter used in a standard inspection flowautomatically selected corresponding to the kind of the object; and aninspection processor for controlling whole of the programming apparatusand for executing the following processes.

The inspection processor displays the guidance of the programming steps,and automatically selects a standard inspection flow from the standardflow memory corresponding to the input or selection of the kind of theobject by the user. Subsequently, the inspection processor reads out atleast one image processing algorithm from the algorithm memory and atleast one inspection parameter from the standard flow memorycorresponding to the selection by the user, so that the inspectionprocessor programs a provisional visual inspection program by using thestandard inspection flow, the image processing algorithm(s) and theinspection parameter(s). When the provisional visual inspection programis programmed, the inspection processor processes the sample image dataof defective units and non-defective units by following the provisionalvisual inspection program, and executes the visual inspection whether anappearance of the object with respect to each sample image data isdefective or non-defective using processed image data. The inspectionprocessor displays the results of the visual inspection of the sampleimage data on the monitor display of the display unit. Furthermore, theinspection processor requires the user whether the provisional visualinspection program is proper or improper. When the user is satisfied bythe result of the visual inspection of the sample image data, theinspection processor outputs the provisional visual inspection programis outputted as a final visual inspection program used in the visualinspection apparatus. Alternatively, when the user is not satisfied bythe result of the visual inspection of the sample image data, theinspection processor further requires the user to change at least oneimage processing algorithm and/or at least one inspection parameteruntil the provisional visual inspection program will be judged proper.

By such a configuration, the user of the visual inspection apparatusunaccustomed to the programming language and/or the image processing caneasily program the visual inspection program suitable for inspecting theoptional object he wishes to inspect. Especially, the sample image dataof the defective units and non-defective units of the object areactually inspected by using the provisional visual inspection program,so that it can easily be judged whether the provisional visualinspection program is proper or improper by considering the result ofthe inspection. Furthermore, when the provisional visual inspectionprogram is judged improper, it is possible to compensate the provisionalvisual inspection program until it is judged proper by changing theimage processing algorism and/or the inspection parameters.

A visual inspection apparatus in accordance with the present inventioncomprises: an image acquisition unit for taking a visual image of anobject conveyed on a manufacturing line thereof; and a removing unit forremoving or for instructing to remove an object judged defective fromthe manufacturing line, further to the above-mentioned function of theprogramming apparatus of the visual inspection program.

By such a configuration, the user of the visual inspection apparatus candirectly program the visual inspection program into a memory of thevisual inspection apparatus. Thus, when the object to be inspected ischanged, the user can easily change the visual inspection programsuitable for inspecting the optional object he wishes to inspect.

A method for programming a visual inspection program in accordance withthe present invention comprises the steps of: memorizing a plurality ofimage processing algorithm with respect to each inspection item, atleast one standard inspection flow and a plurality of inspectionparameters with respect to each kind of object to be inspected;requiring the user to input or to select a kind of the object to beinspected; requiring the user to input a plurality of sample image dataof defective units and non-defective units of objects to be inspected;automatically selecting a standard inspection flow corresponding to thekind of the object among the previously memorized standard inspectionflows; requiring the user to select at least one image processingalgorithm and at least one inspection parameter among the previouslymemorized image processing algorithms and the inspection parameters byfollowing the selected standard inspection flow; programming aprovisional visual inspection program using the elected standardinspection flow, the image processing algorithm(s) and the inspectionparameter(s); reading out the sample image data one by one; executingvisual inspection of the sample image data by following the provisionalvisual inspection program; executing the visual inspection with respectto each sample image data whether an appearance of the object isdefective or non-defective; and displaying the result of the judgment ofthe visual inspection of the sample image data on the monitor display.

By such a configuration, the user unaccustomed to the programminglanguage and/or the image processing can easily program the visualinspection program suitable for inspecting the optional object he wishesto inspect by following the requirement in the programming method.Furthermore, the visual inspection program programmed by this method isevaluated by actually executing the visual inspection with respect tothe sample image data, so that the visual inspection program used in thevisual inspection apparatus becomes reliable and precise.

A program for programming the visual inspection program in accordancewith the present invention comprises the steps of: requiring a user toinput or to select a kind of an object to be inspected; automaticallyselecting a standard inspection flow among a plurality of standardinspection flows previously inputted corresponding to the input orselection of the kind of the object by the user; requiring the user toinput at plurality of sample image data of the object including at leastone defective unit and at least one non-defective unit; requiring theuser to select at least one image processing algorithm and at least oneinspection parameter among a plurality of image processing algorithmsand a plurality of inspection parameters previously inputted;programming a provisional visual inspection program using the selectedstandard inspection flow, the image processing algorithm(s) and theinspection parameter(s); reading the sample image data one by one;executing the visual inspection with each sample image data by followingthe provisional visual inspection program; judging whether the sampleimage data is defective or non-defective; and displaying the result ofthe judgment with respect to all the sample image data on a monitordisplay.

By such a configuration, when the program is installed into a knownpersonal computer, the personal computer can be used as the programmingapparatus of the visual inspection apparatus in accordance with thepresent invention. The program can be downloaded from a server of thevender supplying the visual inspection apparatus, so that the user caneasily program the visual inspection program suitable for the optionalobject which the user wishes to inspect, at any time.

A recording medium in accordance with the present invention memorizes atleast one standard inspection flow with respect to each kind of objectto be inspected, a plurality of image processing algorithm with respectto each inspection item, a plurality inspection parameters and a programfor programming a visual inspection program. The program comprises thesteps of: requiring a user to input or to select a kind of the object tobe inspected; requiring the user to input a plurality of sample imagedata of defective units and non-defective units of objects to beinspected which are previously prepared by a user; automaticallyselecting a standard inspection flow corresponding to the kind of theobject among the previously memorized standard inspection flows;requiring the user to select at least one image processing algorithmsand at least one inspection parameter among the previously memorizedimage processing algorithms and the inspection parameters by followingthe selected standard inspection flow; programming a provisional visualinspection program using the selected standard inspection flow, theimage processing algorithm(s) and the inspection parameter(s); readingout the sample image data one by one for executing visual inspection byfollowing a provisional visual inspection program configured by theelected standard inspection flow, the image processing algorithm(s) andthe inspection parameter(s); executing the visual inspection withrespect to each sample image data whether an appearance of the object isdefective or non-defective by following the provisional visualinspection program; and displaying the result of the judgment of thevisual inspection of the sample image data on the monitor display.

By such a configuration, the user already has the visual inspectionapparatus can easily program the visual inspection program suitable forthe optional object which the user wishes to inspect, after the purchaseof the visual inspection apparatus.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram for showing a configuration of a programmingapparatus of a visual inspection program in accordance with a firstembodiment of the present invention;

FIG. 2 is a drawing schematically for showing contents of each block ofthe programming apparatus in the first embodiment;

FIG. 3 is a block diagram for showing examples of kinds of products tobe inspected in the first embodiment;

FIG. 4 is a drawing for showing an example of a display of a standardinspection flow on a display unit of the programming apparatus in thefirst embodiment;

FIG. 5 is a block diagram for showing folders and examples of image dataof defective units memorized in the folders in the first embodiment;

FIG. 6 is a block diagram for showing an example of folders into whichimage data of defective units and non-defective units are sorted in thefirst embodiment;

FIG. 7 is a block diagram for showing another example of folders intowhich image data corresponding to illumination methods in the firstembodiment;

FIG. 8 is a block diagram for showing examples of surface nature ormaterials of the object to be inspected in the first embodiment;

FIG. 9 is a block diagram for showing examples of surface colors of theproducts to be inspected in the first embodiment;

FIGS. 10A and 10B are drawings for showing a flowchart of programmingsteps of the visual inspection program in the first embodiment;

FIGS. 11A and 11B are drawings for showing images of a product displayedon the display unit of the programming apparatus in the first embodimentby which a region to be inspected on a surface of the product can beselected;

FIG. 12 is a drawing for showing images of the product before and afterimage processing in the programming steps of the visual inspectionprogram in the first embodiment;

FIGS. 13A to 13C are drawings for showing a flowchart of a firstmodification of the programming steps of the visual inspection programin the first embodiment;

FIGS. 14A to 14C are drawings for showing a flowchart of a secondmodification of the programming steps of the visual inspection programin the first embodiment;

FIG. 15 is a drawing for showing a table of inspection parameters andspecific values thereof in the second modification of the programmingsteps of the visual inspection program in the first embodiment;

FIGS. 16A to 16C are drawings for showing a flowchart of a thirdmodification of the programming steps of the visual inspection programin the first embodiment;

FIG. 17 is a drawing for showing a table of judgments of sample imagedata used in the programming steps of the visual inspection program withrespect to respective image processing algorithms in the firstembodiment;

FIG. 18 is a block diagram for showing a system configured by aprogramming apparatus of a visual inspection program and a visualinspection apparatus in accordance with a second embodiment of thepresent invention; and

FIG. 19 is a block diagram for showing a configuration of a visualinspection apparatus having a function of a programming apparatus of avisual inspection program in accordance with a third embodiment of thepresent invention.

BEST MODE FOR CARRYING OUT THE INVENTION

A first embodiment of the present invention is described. A programmingapparatus of a visual inspection program in accordance with the presentinvention supports a user of a visual inspection apparatus easily forprogramming the visual inspection program used in the visual inspectionapparatus and suitable for inspecting products conveyed on amanufacturing line.

In this embodiments, it is possible that the programming apparatus isindependent from the visual inspection apparatus. Alternatively, it ispossible that the programming apparatus is included in the visualinspection apparatus. In the former case, a program for programming thevisual inspection program can be installed in a known apparatus such asa personal computer or a dedicated apparatus described below. In thelatter case, a processing unit of the visual inspection apparatus servesas the programming apparatus.

FIG. 1 shows a block diagram of the programming apparatus 20 in thefirst embodiment. FIG. 2 visually shows the contents of each block ofthe programming apparatus 20.

An input unit 1 is configured by a key board 11, a mouse 12 and so on,by which the user of the programming apparatus 20 can input, forexample, his judgment with respect to a result of a visual inspection,or his selection of parameters and image processing algorithms, and soon used in the visual inspection steps. A display unit 2 is configuredby a monitor display such as a CRT (Cathode Ray Tube apparatus) or a LCD(Liquid Crystal Display apparatus) for displaying visual images of theproducts to be inspected before and after the image processing, or fordisplaying a guidance of input operation for programming the visualinspection program.

An image data memory 3 is configured by a recording and reproducingapparatus for recording and reading the image data on and from arecording medium such as a hard disc, a magneto-optical disk (MO disc)or a magnetic disc. The image data memory 3 memorizes the image data ofdefective units and non-defective units which are previously taken bythe user with using an image acquisition unit 7. The image acquisitionunit 7 is configured by a camera 71 using an image acquisition devicesuch as CCD and a signal processor 72. Samples of the defective unitsand the non-defective units of the products to be inspected are preparedby the user.

In the image data memory 3, hierarchical folders are provided. When theproduct to be inspected is a switch, a folder named “DEFECTIVE” formemorizing the image data of the defective units and a folder named“NON-DEFECTIVE” for memorizing the image data of the non-defective unitsare provided below a folder named “SWITCH”, as shown in FIG. 2.Furthermore, a plurality of folders named “CRACK” and so oncorresponding to the causes of the defective such as an occurrence of acrack, an extraneous matter, and so on are provided below the foldernamed “DEFECTIVE”.

An algorithm memory 4 is configured by a recording and reproducingapparatus for recording and reading the image data on and from arecording medium such as a hard disc, an MO disk or a magnetic disc. Thealgorithm memory 4 memorizes a plurality of image processing algorithms(inspection items) used for inspection of tinted extraneous matter,occurrence of crack, and so on with respect to each product to beinspected. The image processing algorithms are selected by the user inthe programming process of the visual inspection program suitable forthe inspection of the products.

A standard flow memory 5 is configured by a recording and reproducingapparatus for recording and reading the image data on and from arecording medium such as a hard disc, a magneto-optical disk or amagnetic disc. The standard flow memory 5 memorizes a plurality ofstandard inspection flows and inspection parameters respectivelysuitable for kinds of products to be inspected such as a switch, acircuit breaker or a receptacle. The standard inspection flows arepreviously prepared by, for example, a programmer in the vendor of thevisual inspection apparatus responding to the request of the user whowishes to inspect his products, visually. Details of the standardinspection program will be described below.

The image data memory 3, the algorithm memory 4 and the standard flowmemory 5 can be configured by the same recording and reproducingapparatus. Alternatively, they can respectively be configured byindependent recording and reproducing apparatuses.

An inspection processor 6 is configured by a CPU (Central ProcessingUnit), a memory and a control program for controlling the programmingapparatus of the visual inspection program. The inspection processor 6is used not only for controlling the elements of the programmingapparatus 20 wholly, but also for executing the programming steps of thevisual inspection program by the programming apparatus 20.

An output unit 8 is configured by a recording apparatus for recordingthe visual inspection program programmed by the programming apparatus 20into a recording medium 81 such as a CD-R (Compact Disc Recordable), anMO disc, a floppy disc, or the like.

FIG. 3 shows examples of the kinds of the products to be inspected. Thestandard flow memory 5 memorizes the standard inspection flows and theinspection parameters used in respective standard inspection flowscorresponding to the lowest hierarchical names of the products. Thekinds of the products are sorted corresponding to the materials of thesurface of the products at first stage. Furthermore, the kinds of theproducts are sorted corresponding to the use of the products at secondstage. Still furthermore, the kinds of the products are sorted by thetrade name or the parts name of the products at third stage.

FIG. 4 shows an example of a guidance of programming steps displayed onthe monitor display of the display unit 2, when the standard inspectionflow suitable for visual inspection of the switch is read out from thestandard flow memory 5. Since the guidance is displayed on the displayunit 2, so that the user can serially input the image data and selectthe inspection items and/or the inspection parameters by following theinstruction in the guidance.

FIG. 5 shows examples of the image data of the defective units of theswitches. Three folders named “CRACK”, “CHIPPING” and “EXTRANEOUS” areprovided below the folder “DEFECTIVE”. Image data of the samples of thedefective units of the switches are taken by the user by using the imageacquisition unit 7 prior to the programming of the visual inspectionprogram. The image data are sorted corresponding to the kinds of thedefect and memorized in the folder corresponding to the defect.

FIG. 6 shows an example of the sorting of the image data of thedefective units and non-defective units. In this example, the image dataare further sorted corresponding to the degree of defects into thefolders named “MAJOR DEFECT”, “MIDDLE DEFECT”, “MINOR DEFECT”,“ACCEPTABLE”, “GOOD” and “SPLENDID”. The image data sorted into thefolder of acceptable has some defects but it is acceptable to beshipped. The image data sorted into the folder of good has a littledefect but the defect is no problem. The image data sorted into thefolder of splendid rarely has defect. It is possible to provide a foldernamed “PERFECT” (not shown in the figure) into which the image datahaving no defect is sorted. The image data sorted into the folder ofmajor defect, middle defect or minor defect has defects not acceptable.

FIG. 7 shows another example of sorting of the image data correspondingto the illumination method when the image data of the sample of thedefective units and non-defective units of the products are taken. Threefolders named “DIFFUSED ILLUMINATION”, “COAXIAL ILLUMINATION” and“OBLIQUE ILLUMINATION” are provided. When the same object is illuminatedby different illumination methods, the image data taken under thedifferent illumination method will be different at all. Furthermore,there is the most suitable illumination method corresponding to thespecification of the products. The folders of defective units and nondefective units are provided below the respective folders with respectto the illumination methods.

FIG. 8 shows examples of the surface nature or the materials of theproducts to be inspected. Generally, a convex and concave structure isformed on the surface of the product. When the convex and concavestructure on the surface of the product is sharp, shadows of the convexand concave structure will be observed according to the illuminationmethod. Alternatively, when the convex and concave structure on thesurface of the product is dull, edges of the convex and concavestructure cannot be observed according to the illumination method. Thus,the standard flow memory 5 memorizes several kinds of the standardinspection flows and inspection parameters corresponding to the convexand concave structure of the surface of the products. Furthermore, thesurface of the product is generally finished such as stain finish,mirror finish or lusterless corresponding to the surface nature ormaterial of the product. The standard flow memory 5 further memorizesseveral kinds of the standard inspection flows and inspection parameterscorresponding to the surface nature or material of the surface of theproducts.

FIG. 9 shows examples of surface colors of the products to be inspected.Generally, coloring such as white, ivory, black or the like is providedon the surface of the products having the same shape for differentiatingthe products or for improving the appearance of the products. The imagedata of the product having the surface color of white is clearlydifferent from that having the surface color of black even though theproducts have the same shape and the image data are taken under the samecondition. Thus, the standard flow memory 5 memorizes several kinds ofthe standard inspection flows and inspection parameters corresponding tothe surface colors of the surface of the products.

Subsequently, the programming steps of the visual inspection program inthe first embodiment is described with reference to a flow chart shownin FIGS. 10A and 10B.

When the program for programming the visual inspection program memorizedin the inspection processor 6 is started, the inspection processor 6displays a predetermined message on the display unit 2 which requiresthe user to input or to select a kind of product to be inspected (stepS100). When the user inputs or selects the switch as the product to beinspected, the inspection processor 6 further requires the user toselect the illumination method for illuminating the product to beinspected or to select the image acquisition condition for taking theimage data of the product on a manufacturing line (step S101). When theillumination method or image acquisition condition is selected, theinspection processor 6 still further requires the user to select thesurface nature and surface color of the switch (step S102).

When the kind of the product, the illumination method, the surfacenature and the surface color of the product are inputted or selected bythe user, the inspection processor 6 reads out a standard inspectionflow suitable for inspecting the product from the standard flow memory 5(step S103). When the standard inspection flow is read out, theinspection processor 6 displays a standard display, for example, shownin FIG. 4 on the display unit 2 (step S104).

Subsequently, the inspection processor 6 requires the user to inputsample image data of the defective units and non defective units of theproduct (step S105). The sample image data is taken by the imageacquisition unit 7 at the time or prior to the programming of the visualinspection program. When the sample image data is inputted, theinspection processor 6 memorizes the sample image data into the imagedata memory 3 and further requires the user to select at least one imageprocessing algorithm such as inspection of occurrence of crack, adhesionof extraneous matter, occurrence of chipping, or the like (step S106).When at least one of the algorithm is selected, the inspection processor6 still further requires the user to select the inspection parameters(step S107). The inspection parameters includes a plurality of settingparameters used in the image processing steps and a plurality of judgingparameters used for judging whether the visual inspection result of theproduct is acceptable or not. The setting parameters are, for example, aregion to be inspected, and levels of the image processing such as thefiltering of the image data, the binary processing and the differentialprocessing.

An example for setting the parameter of the region to be inspected isdescribed with reference to FIGS. 11A and 11B which show side views ofthe product such as the switch to be inspected. In FIG. 11A, a pointer100 having an arrow shape is moved to a position P1, for example,disposed in the vicinity of the upper left end of the side face of theswitch by operating the mouse 12 of the input unit 1. While a switchbutton of the mouse 12 is switched on, the pointer 100 is moved to aposition P2 disposed in the vicinity of the lower right end of the sideface of the switch. When the switch button of the mouse 12 is switchedoff, a rectangular region 101 to be inspected is selected. In the region101, an extraneous matter 102 which is the cause of the defect isincluded. The shape of the region to be inspected, however, is notrestricted by the rectangle. It is possible to select an optional shapesuch as a circle, an ellipse, a polygon, or the like suitable forinspecting the product.

When the inspection parameters are selected, a provisional visualinspection parameter is programmed. Thus, the inspection processor 6starts to execute the provisional visual inspection program. Theinspection processor 6 reads out the sample image data of the defectiveunits and the non-defective units of the product serially from the imagedata memory 3 (step S108). The inspection processor 6 executes the imageprocessing of the sample image data by following the provisional visualinspection program (step S109). When the image processing of the sampleimage data is completed, the inspection processor 6 displays an originalimage using the original image data and a processed image data using theprocessed image data on the display unit 2 (step S110).

Examples of the original image and the processed image displayed on thedisplay unit 2 are shown in FIG. 12. As shown in FIG. 12, the originalimage and the processed image are displayed on the same monitor displayof the display unit at the same time. The original image is disposed atthe left side, and the processed image is disposed at the right hand.The extraneous matter 102A in the original image is blurred, but theextraneous matter 102B in the processed image is cleared. Displays ofpredetermined information data 103 and 104 are superimposed on theoriginal image and the processed image. The information data 103 withrespect to the original image includes a file name such as “NG1”, a nameof product such as “switch”, a kind of the product such as “SW1”, acause of the defects such as “extraneous matter” and a rank of thedefect such as “major defect”. The pointer 100 is further displayed onthe processed image for designating the portion of the defect such asthe extraneous matter 103B. The information data 104 with respect to theprocessed image includes a result of the inspection such as “NG”, anarea of the portion of the defect and the land number of the defects.

Subsequently, the inspection processor 6 executes the judgment of thevisual inspection whether the appearance of the product has aunacceptable defect or not (step S111). The inspection processor 6repeats the steps S108 to S111 until the judgments with respect to allthe sample image data are completed (step S112).

When the judgments with respect to all the sample image data arecompleted, the inspection processor 6 displays the results of thejudgment on the display unit 2 (step S113). The user judges whether theresults of the judgments of the visual inspection of the sample imagedata of the product can be acceptable or not (step S114).

Hereupon, when the provisional visual inspection program is properlyprogrammed, the sample image data of the defective units of the productare judged to be unacceptable, and the sample image data of thenon-defective units are judged to be acceptable. On the other hand, whenthe provisional visual inspection program is improperly programmed, thesample image data of the defective units of the product are judged to beacceptable, or the sample image data of the non-defective units arejudged to be unacceptable. Thus, when the results of the visualinspection of the sample image data are not acceptable, the user inputsa predetermined command such as “NO” by using the input unit 1, and theinspection processor 6 returns to the step S106 for re-requiring theuser to select the image processing algorithm and the inspectionparameters again. The steps S106 to S113 will be repeated until theresults of the visual inspection of the sample image data becomesacceptable.

When the results of the visual inspection of the sample image data areacceptable, the user inputs a predetermined command such as “YES” byusing the input unit 1, and the inspection processor 6 outputs theprovisional visual inspection program configured by the standardinspection flow and the selected image processing algorithms and theinspection parameters to the output unit 8 as a final visual inspectionprogram. The output unit 8 records the visual inspection program into arecording medium such as the CD-R, the MO disc, or the like (step S114).When the visual inspection program is outputted, the inspectionprocessor 6 completes the program for programming the image inspectionprogram.

In the above-mentioned flowchart, the position of the step for inputtingthe sample image data is not restricted by the description. It ispossible to input the sample image data at any time when the user wishesuntil the provisional visual inspection program is started. The samerule applies correspondingly to the following flowcharts.

As mentioned above, the user unaccustomed to the programming languageand/or image processing can easily program the visual inspection programsuitable for the product to be inspected by using the programmingapparatus in the first embodiment.

A first modification of the programming steps of the visual inspectionprogram in the first embodiment is described with reference to a flowchart shown in FIGS. 13A to 13C. In the following modifications whichwill be described below, the steps for displaying the standard displayon the display unit, for selecting the illumination method, and forselecting the surface nature and the surface color of the product areomitted.

For example, when the product to be inspected is the switch, it isconsidered that the defects of the switch are caused by the occurrenceof the crack, scratch, chipping or the adhesion of extraneous matters.In the first modification, the inspection items or the image processingalgorithms, the standard inspection flow and the inspection parameters,or the combination of them, which are recommended by the expert of theimage processing, are previously programmed, and automatically read outfrom the algorithm memory 4 and the standard flow memory 5, when theuser inputs or selects the kind of the product to be inspected.

When the program for programming the visual inspection program memorizedin the inspection processor 6 is started, the inspection processor 6displays a predetermined message on the display unit 2 which requiresthe user to input or to select the kind of product to be inspected (stepS200). When the user selects the switch as the product to be inspected,the inspection processor 6 selects a standard inspection flow from thestandard flow memory 5, at least one of the image processing algorithmand the inspection parameters from the algorithm memory 4 which aresuitable for inspecting the product and recommended by the expert (stepS201).

When the standard inspection flow and so on are selected, the inspectionprocessor 6 requires the user to input sample image data of thedefective units and non defective units of the switch (step S202). Whenthe sample image data are inputted, the inspection processor 6 memorizesthe sample image data into the image data memory 3. Subsequently, theinspection processor 6 starts the visual inspection by following aprovisional visual inspection program configured by the selectedstandard inspection flow, the image processing algorithms and theinspection parameters (step S203).

The inspection processor 6 reads out the sample image data of thedefective units and the non-defective units of the product serially fromthe image data memory 3 (step S204). When one of the sample image datais read out, the inspection processor 6 executes the detection andlocation of the edges of the image using the sample image data in thehorizontal direction by following the provisional visual inspectionprogram (step S205). Subsequently, the inspection processor 6 executesthe detection and location of the edges of the image in the verticaldirection (step S206).

When the locations of the edges of the image in the horizontal andvertical directions are completed, the inspection processor 6 executesthe inspection of the occurrence of the crack (step S207), theoccurrence of the chipping (step S208), the adhesion of the extraneousmatters (step S209) and the occurrence of the scratch (step S210) withrespect to each surface of the product.

When the above-mentioned inspections are completed with respect to eachsample image data, the inspection processor 6 executes the judgment ofthe visual inspection whether the appearance of the product has a defectunacceptable or not (step S211). When the judgment of the visualinspection of the sample image is completed, the inspection processor 6judges whether the sample image data executed by the above-mentionedinspections is non-defective or defective (step S212).

When the sample image data is non-defective, the inspection processor 6further judges whether the result of the judgment of the visualinspection is non-defective or not (step S213). When the judgment of thevisual inspection is non-defective, the result of the judgment coincideswith the nature of the sample image data, so that the inspectionprocessor 6 judges the provisional visual inspection program configuredby standard inspection flow, the image processing algorithms and theinspection parameters is proper (or good) visually for inspecting theswitch (step S214). Alternatively, when the judgment of the visualinspection is defective, the result of the judgment does not coincidewith the nature of the sample image data, so that the non-defective unitwill be lost by miss-judgment of the visual inspection. Thus, theinspection processor 6 judges the provisional visual inspection programis improper (no good) visually for inspecting the switch (step S215).

When the sample image data is defective in the step S212, the inspectionprocessor 6 further judges whether the result of the judgment of thevisual inspection is defective or not (step S216). When the judgment ofthe visual inspection is defective, the result of the judgment coincideswith the nature of the sample image data, so that the inspectionprocessor 6 judges the provisional visual inspection program is proper(good) visually for inspecting the switch (step S217). Alternatively,when the judgment of the visual inspection is non-defective, the resultof the judgment does not coincide with the nature of the sample imagedata, so that the defective unit will be included in the non-defectiveunits by miss-judgment of the visual inspection. Thus, the inspectionprocessor 6 judges the provisional visual inspection program is improper(no good) visually for inspecting the switch (step S218).

When the provisional visual inspection program is judged proper in thesteps S214 and S217, the inspection processor 6 judges whether thevisual inspections with respect to all the sample image data arecompleted or not (step S219). When all the sample data are not inspectedyet, the inspection processor 6 returns to the step S204 for repeatingthe steps S204 to S219 and S221 (described below) with respect to thenext sample image data. Alternatively, when all the sample data areinspected, the inspection processor 6 outputs the provisional visualinspection program configured by the standard inspection flow, theselected image processing algorithms and the inspection parameters to amemory of the visual inspection apparatus or records the provisionalvisual inspection program into a recording medium such as a CD-R, an MOdisc, or the like as the visual inspection program (step S220). When thevisual inspection program is outputted, the inspection processor 6completes the program for programming the image inspection program.

When the provisional visual inspection program is judged improper in thesteps S215 and S218, the inspection processor 6 requires the user tochange at least one image processing algorithms and/or at least oneinspection parameter (step S221), and returns to the step S207 forrepeating the steps S207 to S219 and S221 with respect to the samesample image data.

In the above-mentioned first modification, the combination of thestandard inspection flow, the image processing algorithms and theinspection parameters which are recommended by the expert of the imageprocessing is automatically selected when the user inputs or selects thekind of the product to be inspected, so that the user unaccustomed tothe programming language and the image processing can easily program thevisual inspection program suitable for the specific product to beinspected. Furthermore, the judgment whether the provisional visualinspection program configured by the standard inspection flow, the imageprocessing algorithms and the inspection parameters are proper orimproper visually for inspecting the product such as the switch selectedby the user is automatically judged by the program for programming thevisual inspection program. Thus, the user occasionally participates inthe programming processes for programming the visual inspection programsuitable for the specific product to be inspected.

A second modification of the programming steps of the visual inspectionprogram in the first embodiment is described with reference to a flowchart shown in FIGS. 14A to 14C. For simplifying the description of thesecond modification, only the occurrence of the crack is inspected asthe inspection item. In the second modification, a plurality of theimage processing algorithms with respect to the same inspection item areprepared, and each image processing algorithm has a precedence value.Furthermore, each sample data used for the visual inspection has aninitial value of the precedence.

When the program for programming the visual inspection program memorizedin the inspection processor 6 is started, the inspection processor 6displays a predetermined message on the display unit 2 which requiresthe user to input or to select the kind of product to be inspected (stepS300). When the user inputs or selects the switch as the product to beinspected, the inspection processor 6 selects a standard inspection flowfrom the standard flow memory 5, at least one of the image processingalgorithm and so on (step S301).

When the standard inspection flow and so on are selected, the inspectionprocessor 6 requires the user to input sample image data of thedefective units and non-defective units of the product and the initialprecedence with respect to each sample image data (step S302). When thesample image data and the initial precedence values are inputted, theinspection processor 6 memorizes the sample image data and the initialprecedence values into the image data memory 3. Subsequently, theinspection processor 6 starts a provisional visual inspection programconfigured by the standard inspection flow and so on for inspecting thesample image data (step S303).

The inspection processor 6 reads out the sample image data of thedefective units and the non-defective units of the product serially fromthe image data memory 3 (step S304). When one of the sample image datais read out, the inspection processor 6 executes the detection andlocation of the edges of the image using the sample image data in thehorizontal and vertical directions (step S305).

When the locations of the edges of the image in the horizontal andvertical directions are completed, the inspection processor 6 reads outthe initial precedence value “I” of the image data (step S306). When theinitial precedence value I=1, the inspection processor 6 reads out andexecutes the image processing algorithm such as a first crack inspectionhaving the precedence value I=1 (step S307). When the initial precedencevalue I=2, the inspection processor 6 reads out and executes the imageprocessing algorithm such as a second crack inspection having theprecedence value I=2 (step S308).

When the above-mentioned crack inspection is completed, the inspectionprocessor 6 executes the judgment of the visual inspection whether theappearance of the product has a defect unacceptable or not (step S309).When the judgment of the visual inspection of the sample image iscompleted, the inspection processor 6 judges whether the sample imagedata executed by the above-mentioned inspections is non-defective ordefective (step S310).

When the sample image data is non-defective, the inspection processor 6further judges whether the result of the judgment of the visualinspection is non-defective or not (step S311). When the judgment of thevisual inspection is non-defective, the result of the judgment coincideswith the nature of the sample image data and the precedence value of thesample image data is proper, so that the inspection processor 6 judgesthe provisional visual inspection program configured by the standardinspection flow, the image processing algorithms and the inspectionparameters is proper (good) visually for inspecting the product (stepS312). Alternatively, when the judgment of the visual inspection isdefective, the result of the judgment does not coincide with the natureof the sample image data, so that the non-defective unit will be lost bymiss-judgment of the visual inspection due to the improper precedencevalue of the sample image data. Thus, the inspection processor 6 judgesthe provisional visual inspection program is improper (no good) visuallyfor inspecting the product (step S313).

When the sample image data is defective in the step S310, the inspectionprocessor 6 further judges whether the result of the judgment of thevisual inspection is defective or not (step S314). When the judgment ofthe visual inspection is defective, the result of the judgment coincideswith the nature of the sample image data, so that the inspectionprocessor 6 judges the provisional visual inspection program is proper(good) visually for inspecting the product (step S315). Alternatively,when the judgment of the visual inspection is non-defective, the resultof the judgment does not coincide with the nature of the sample imagedata, so that the defective unit will be included in the non-defectiveunits by miss-judgment of the visual inspection. Thus, the inspectionprocessor 6 judges the provisional visual inspection program is improper(no good) visually for inspecting the product (step S316).

When the standard inspection flow is judged proper in the steps S312 andS315, the inspection processor 6 judges whether the visual inspectionswith respect to all the sample image data are completed or not (stepS317). When all the sample data are not inspected yet, the inspectionprocessor 6 returns to the step S304 for repeating the steps S304 toS317 and S319 to S322 (described below) with respect to the next sampleimage data. Alternatively, when all the sample data are inspected, theinspection processor 6 outputs the provisional visual inspection programconfigured by the standard inspection flow, the selected imageprocessing algorithms and the inspection parameters to a memory of thevisual inspection apparatus or records the visual inspection programinto a recording medium such as a CD-R, an MO disc, or the like as afinal visual inspection program (step S318). When the visual inspectionprogram is outputted, the inspection processor 6 completes the programfor programming the image inspection program.

When the provisional visual inspection program is judged improper in thesteps S313 and S316, the inspection processor 6 inquires the user tochange the precedence value or not (step S319). When the user wishes tochange the precedence value, the inspection processor 6 requires theuser to change the precedence value of the sample image data (stepS320). When the user does not wish to change the precedence value (NO inthe step S319) or when the precedence value is changed in the step S320,the inspection processor 6 further inquires the user to change theinspection parameters (step S321). When the user wishes to change theinspection parameters, the inspection processor 6 requires the user tochange the inspection parameters (step S322). When the user does notwish to change the inspection parameters (NO in the step S321) or whenthe inspection parameters are changed in the step S322, the inspectionprocessor 6 returns to the step S306 for repeating the steps S306 toS317 and S319 to S322 with respect to the same sample image data.

In the above-mentioned second modification, the precedence is set to theimage processing algorithms included in the same criteria, and the usercan select the most suitable image processing algorithm visually forinspecting the product to be inspected.

In the second modification, the image processing algorithms have theprecedence. FIG. 15 shows another modification that the inspectionparameters have the precedence. FIG. 15 is a table for showing theexample of the inspection parameters, which is displayed on the displayunit 2. The precedence of each parameter shows the degree that thevariation of the values of the parameter effects the result of the imageprocessing of the image data. In the table shown in FIG. 15, the symbol“+” designates that the value of the parameter is increased from thecurrent value, and the symbol “−” designates that the value of theparameter is decreased from the current value.

In this example, when a result of a visual inspection of a sample imagedata inspected by a standard inspection flow with previously selectedimage processing algorithms and inspection parameters is not acceptable,the parameter having the precedence value “1” such as the thresholdvalue of the edge detection will be varied from the initial value “50”by the predetermined width “52 in both of increasing and decreasingdirections between the limitation values “2” to “100”. The thresholdvalue of the edge detection will be varied as 50→55→45→60→40→65→35 . . .. Similarly, the threshold value of the edge extension will be varied as30→35→25→40→20→45→15 . . . .

By such a configuration, the user can easily change the inspectionparameters by following the precedence, when the provisional visualinspection program is judged improper.

A third modification of the programming steps of the visual inspectionprogram in the first embodiment is described with reference to a flowchart shown in FIGS. 16A to 16C. In the third modification, theprovisional visual inspection program configured by the standardinspection flow, the image processing algorithms and the inspectionparameters is evaluated by number of occurrence of miss-judgment of thevisual inspection of the sample image data.

When the program for programming the visual inspection program memorizedin the inspection processor 6 is started, the inspection processor 6displays a predetermined message on the display unit 2 which requiresthe user to input or to select the kind of product to be inspected (stepS400). When the user inputs or selects the switch as the product to beinspected, the inspection processor 6 selects a standard inspection flowfrom the standard flow memory 5 (step S401).

When the standard inspection flow is selected, the inspection processor6 requires the user to input sample image data of the defective unitsand non-defective units of the product (step S402). When the sampleimage data are inputted, the inspection processor 6 memorizes the sampleimage data into the image data memory 3. Subsequently, the inspectionprocessor 6 requires the user to select at lest one image processingalgorithm (step S403), and to select the inspection parameters (stepS404).

Subsequently, the inspection processor 6 reads out the sample image dataof the defective units and the non-defective units of the productserially from the image data memory 3 (step S405). When one of thesample image data is read out, the inspection processor 6 executes theprovisional visual inspection program such as the detection and locationof the edges of the image using the sample image data in the horizontaland vertical directions, the filtering process, and so on (step S406).

When the image processing is completed, the inspection processor 6displays the original image and the processed image on the display unit2 (step S407). Simultaneously, the inspection processor 6 executes thejudgment of the visual inspection whether the appearance of the producthas a defect unacceptable or not (step S408). When the judgment of thevisual inspection of the sample image is completed, the inspectionprocessor 6 judges whether the sample image data executed by theabove-mentioned inspections is non-defective or defective (step S409).

When the sample image data is non-defective, the inspection processor 6further judges whether the result of the judgment of the visualinspection is non-defective or not (step S410). When the judgment of thevisual inspection is non-defective, the result of the judgment coincideswith the nature of the sample image data, so that the inspectionprocessor 6 judges the provisional visual inspection program configuredby the standard inspection flow, the image processing algorithms and theinspection parameters is proper (good) visually for inspecting theproduct (step S411). Furthermore, the inspection processor 6 increases acount of a first counter by one (step S412). Alternatively, when thejudgment of the visual inspection is defective, the result of thejudgment does not coincide with the nature of the sample image data, sothat the non-defective unit will be lost by miss-judgment of the visualinspection (step S413). The inspection processor 6 increases a count ofa second counter by one (step S414).

When the sample image data is defective in the step S409, the inspectionprocessor 6 further judges whether the result of the judgment of thevisual inspection is defective or not (step S415). When the judgment ofthe visual inspection is defective, the result of the judgment coincideswith the nature of the sample image data, so that the inspectionprocessor 6 judges whether the provisional visual inspection program isproper (good) visually for inspecting the product (step S416). Theinspection processor 6 increases a count of a third counter by one (stepS417). Alternatively, when the judgment of the visual inspection isnon-defective, the result of the judgment does not coincide with thenature of the sample image data, so that the defective unit will bemixed in the non-defective units by miss-judgment of the visualinspection (step S418). The inspection processor 6 increases a count ofa fourth counter by one (step S419).

When the count of any of the first to fourth counters is increased, theinspection processor 6 judges whether the visual inspections withrespect to all the sample image data are completed or not (step S420).When all the sample data are not inspected yet, the inspection processor6 returns to the step S405 for repeating the steps S405 to S420 withrespect to the next sample image data. Alternatively, when all thesample data are inspected, the inspection processor 6 displays thecounts of the first to fourth counters in a table on the display unit 2(step S421). Simultaneously, the inspection processor 6 requires theuser whether the results of the counts of the first to fourth countersthat is the result of the visual inspection of the sample image data isacceptable or not (step S422).

When the user judges that the result of the visual inspection of thesample image data is acceptable, the user inputs a predetermined commandsuch as “YES” by using the input unit 1. The inspection processor 6outputs the provisional visual inspection program configured by thestandard inspection flow, the selected image processing algorithms andthe inspection parameters to a memory of the visual inspection apparatusor records the visual inspection program into a recording medium such asa CD-R, an MO disc, or the like as the visual inspection program (stepS423). When the visual inspection program is outputted, the inspectionprocessor 6 completes the program for programming the image inspectionprogram.

Alternatively, when the user judges that the result of the visualinspection of the sample image data is not acceptable, the user inputs apredetermined command such as “NO” by using the input unit 1. Theinspection processor 6 inquires the user to change at least oneinspection parameter (step S424). When the user wishes to change theinspection parameter, the inspection processor 6 displays apredetermined message for requesting the user to change the inspectionparameters, and the inspection processor 6 changes the inspectionparameter responding to the instruction of the user (step S425).Subsequently, the inspection processor 6 returns to the step S406 forrepeating the steps S406 to S420 with respect to the same sample imagedata.

In the above-mentioned third modification, the user can be judgedwhether the visual inspection program is acceptable or not by referringto the counts of the counters showing the ratio of the number of themiss-judgment with respect to the number of the proper judgment. Forexample, even when the miss-judgment for judging the non-defective unitsas the defective units occasionally occurs, the visual inspectionprogram is acceptable while the defective units never included in thenon-defective units. Alternatively, even when the miss-judgment forjudging the defective units as the non-defective units rarely occurs,the visual inspection program is not acceptable while at least onedefective unit is included in the non-defective units.

An example of a table of the judgment of the visual inspection of thesample image data and the ratio of the number of the miss-judgment withrespect to the number of the proper judgment is shown in FIG. 17.

In FIG. 17, the upper half portion of the table shows the inspectionresult that seven non-defective sample image data are inspected by imageprocessing algorithms for inspecting the occurrence of the crack, theoccurrence of the chipping, the adhesion of the extraneous matter andthe occurrence of the scratch, and the lower half portion of the tableshows the inspection result that four defective sample image data causedby the occurrence of the crack and three defective sample image datacaused by the adhesion of the extraneous matter are inspected by thesame image processing algorithms. The boxes disposed at right hand ofthe boxes named “CRACK”, “CHIPPING”, “EXTRANEOUS MATTER” and “SCRATCH”designate the inspection results of the sample image data by using theimage processing algorithms suitable for inspecting the named defects.

In the upper half portion of the table with respect to non-defectivesample image data, the symbol “∘” designates that the non-defectivesample image data are judged non-defective, and the symbol “X”designates that the non-defective sample image data is judged defective.In the lower half portion of the table with respect to the defectivesample image data, the symbol “∘” designates that the defective sampleimage data are judged defective, and the symbol “X” designates that thedefective sample image data is judged non-defective.

For example, the symbol “X” in the box B1 shows that the processed imageof the third non-defective sample image data after the image processingby the image processing algorithm suitable for the inspection of theoccurrence of the chipping was judges defective. Similarly, the symbol“X” in the box B2 shows that the processed image of the sixthnon-defective sample image data after the image processing by the imageprocessing algorithm suitable for the inspection of the occurrence ofthe scratch was judges defective. As mentioned above, it is acceptablethat the non-defective units are occasionally removed from themanufacture line as defective.

On the other hand, the symbol “X” in the box B3 shows that the processedimage of the third defective sample image data caused by the occurrenceof the crack after the image processing by the image processingalgorithm suitable for the inspection of the occurrence of the crack wasjudges non-defective. Similarly, the symbol “X” in the box B4 shows thatthe processed image of the second defective sample image data caused bythe adhesion of the extraneous matter after the image processing by theimage processing algorithm suitable for the inspection of the occurrenceof the crack was judges non-defective.

The visual inspection program used in the visual inspection of thesample image data has a problem that the defect caused by the occurrenceof the crack cannot be sensed by the image processing algorithm suitablefor inspection of the occurrence of the crack. It is necessary to changethe inspection algorithm and/or the inspection parameters so as to judgethe processed image of the third defective sample image data caused bythe occurrence of the crack after the image processing by the imageprocessing algorithm suitable for the inspection of the occurrence ofthe crack as defective or “∘” in the box B3.

Furthermore, it is possible to configure the visual inspection programin a manner so that the original image and the processed image can bedisplayed on the display unit 2 as shown in FIG. 12, when a desired box,for example, the box B5 is selected by the pointer 100.

In the above-mentioned third embodiment, the inspection processor 6displays the counts of the first to fourth counters in the table, forexample, shown in FIG. 17 on the display unit 2 in the step S421, andrequires the user whether the results of the counts of the first tofourth counters that is the result of the visual inspection of thesample image data is acceptable or not in the step S422. It, however, ispossible to configure the flowchart in a manner so that target values ofthe counts of the first to fourth counters are previously set as theinspection parameters; the counts of the first to fourth counters arecompared with the target values; when the counts of the first to fourthcounters satisfy predetermined conditions, the inspection processor 6can judge the provisional visual inspection program proper; and when thecounts of the first to fourth counters do not satisfy predeterminedconditions, the inspection processor 6 changes the inspection parametersby following the precedence until the counts of the first to fourthcounters satisfy predetermined conditions. By such a configuration, thevisual inspection program can substantially automatically programmedwithout the selection of the inspection parameters by the user.

A second embodiment of the present invention is described. FIG. 18 showsa block diagram of a system configured by a programming apparatus 21 ofthe visual inspection program and a visual inspection apparatus 30. Incomparison with FIG. 18 and FIG. 1, the programming apparatus 21 in thesecond embodiment comprises a data communication interface 9 further tothe configuration of the programming apparatus 20 in the firstembodiment.

The data communication interface 9 is communicated with a datacommunication inter face 31 of the visual inspection apparatus 30 by awired or wireless data communication system 40, such as a serial datacommunication system, a parallel data communication system or a LAN(Local Area Network). The inspection processor 6 further includes afunction to output the visual inspection program to the datacommunication interface 9.

By such a configuration, the visual inspection program programmed by theprogramming apparatus 21 can be installed into the visual inspectionapparatus 30 independently provided from the programming apparatus 21without using any recording medium. Furthermore, the same programmingapparatus 21 can commonly be used for programming the visual inspectionprograms for a plurality of the visual inspection apparatuses 30.

Alternatively, the user having the visual inspection apparatus 30 but noprogramming apparatus can use the programming apparatus 21 of the venderof the visual inspection apparatus via the data communication system 40,so that he can obtain the visual inspection program suitable forinspecting the product which he wishes to inspect.

A third embodiment of the present invention is described. FIG. 19 showsa block diagram of a visual inspection apparatus 32 having a function ofa programming apparatus of the visual inspection program. In comparisonwith FIG. 19 and FIG. 1, the visual inspection apparatus 32 in the thirdembodiment comprises an image acquisition unit 7, a visual inspectionprogram memory 15 and a removing unit 16 further to the configuration ofthe programming apparatus 20 in the first embodiment. The function ofthe programming apparatus in the third embodiment is substantially thesame as one of the programming apparatus in the above-mentionedembodiments, so that the detailed description of the function of theprogramming apparatus is omitted.

The image acquisition unit 7 is substantially the same as thatillustrated in FIG. 2, and used not only for taking the sample imagedata used in the programming steps of the visual inspection program butalso for taking visual images of the products conveyed on themanufacturing line in the actual visual inspection of the products. Theinspection program memory 15 is a non-volatile memory such as a harddisc or an EE-PROM (electrically Erasable-Programmable Read Only Memory)for memorizing the visual inspection program programmed by the functionof the programming apparatus. The removing unit 16 includes a mechanismsuch as a removing arm for removing a defective unit of the productsfrom the manufacturing line when the unit is judged as defective byfollowing the visual inspection program. It, however, is possible thatthe removing unit 16 instructs or marks the defective unit to be removedin a downstream portion in the manufacturing line.

When the programming of the visual inspection program is completed, theinspection processor 6 memorizes the visual inspection program into thevisual inspection program memory 15. For executing the visual inspectionof the products conveyed in the manufacturing line, the inspectionprocessor 6 reads out the visual inspection program from the visualinspection memory 15 and executes the visual inspection with respect toeach image data of the product taken by the image acquisition unit 7 oneby one and judges whether the appearance of the product is acceptable ornot. When the appearance of the product is judged defective, theinspection processor 6 controls the removing unit 16 for removing theproduct from the manufacturing line.

By such a configuration, the visual inspection apparatus includes theprogramming apparatus of the visual inspection program, so that the userof the visual inspection apparatus can easily program the visualinspection program suitable for inspecting the product which the userwishes to inspect.

Industrial Applicability

As mentioned above, the user of the visual inspection apparatus caneasily program the visual inspection program suitable for inspecting theproducts which the user wishes to inspect by following the guidancedisplayed on the monitor display of the display unit of the programmingapparatus of the visual inspection program in accordance with thepresent invention, even though the user is unaccustomed to theprogramming language and/or the image processing. Furthermore, theprovisional visual inspection program programmed by the programmingapparatus is evaluated by actually inspecting the sample image dataincluding the defective units and the non-defective units of theproduct, so that the reliability and the accuracy of the visualinspection can be increased. Especially, when the result of theevaluation of the provisional visual inspection program is improper, itis possible to compensate the provisional visual inspection program bychanging at least one image processing algorithm and/or at least oneinspection parameter until the evaluation of the provisional visualinspection program becomes proper. Finally, the provisional visualinspection program evaluated proper is outputted as the visualinspection program, so that the result of the visual inspection of theproducts conveyed on the manufacturing line by the visual inspectionapparatus using the visual inspection program rarely includes erroneouscomponent.

1. A programming apparatus of a visual inspection program comprising: animage data memory that stores a plurality of user prepared sample imagedata of defective units and non-defective units of an object to beinspected; an algorithm memory that stores a plurality of imageprocessing algorithms with respect to each inspection object; a standardflow memory that stores at least one standard inspection flow and aplurality of inspection parameters with respect to each kind of objectto be inspected; a display unit having a monitor display for displayingat least a guidance of programming steps; an input unit configured forinputting or selecting a kind of an object to inspected, and forselecting at least one image processing algorithm and at least oneinspection parameter; and an inspection processor for displaying theguidance of the programming steps, automatically selecting a standardinspection flow from the standard flow memory corresponding to the inputor selection of the kind of the object, reading at least one imageprocessing algorithm from the algorithm memory and at least oneinspection parameter from the standard flow memory corresponding to theselection, programming a provisional visual inspection program by usingthe standard inspection flow, at least one image processing algorithmand at least one inspection parameter, processing the sample image dataof defective units and non-defective units by following the provisionalvisual inspection program, executing the visual inspection to determinewhether an appearance of the object with respect to each sample imagedata is defective or non-defective using processed image data,displaying results of the visual inspection of the sample image data onthe monitor display of the display unit, requiring a judgment whetherthe provisional visual inspection program is proper or improper, andoutputting the provisional visual inspection program as a final visualinspection program upon a judgment that the provisional visualinspection program is proper.
 2. The programming apparatus in accordancewith claim 1, wherein the inspection processor further requires thechanging at least one image processing algorithm and/or at least oneinspection parameter upon a judgment that the provisional visualinspection program is improper.
 3. The programming apparatus inaccordance with claim 2, wherein the inspection processor repeats therequirement for changing the at least one image processing algorithmand/or at least one inspection parameter until the provisional visualinspection program is judged proper.
 4. The programming apparatus inaccordance with claim 1, wherein the image data memory stores with eachsample image data of the defective units with an information of a causeof a defect.
 5. The programming apparatus in accordance with claim 1,wherein the sample image data of the defective units and non-defectiveunits are respectively sorted in the image data memory based upon adegree of defect and a degree of quality.
 6. The programming apparatusin accordance with claim 1, wherein the sample image data of thedefective units and non-defective units are sorted in the image datamemory based upon illumination methods or condition when the sampleimage data are taken.
 7. The programming apparatus in accordance withclaim 1, wherein the standard flow memory stores the standard inspectionflow with at least one inspection parameter corresponding to a surfacenature or a material of the object.
 8. The programming apparatus inaccordance with claim 1, wherein the standard flow memory stores thestandard inspection flow with at least one inspection parametercorresponding to a surface color of the object.
 9. The programmingapparatus in accordance with claim 1, wherein the standard flow memorystores a combination of a standard inspection flow, at least one imageprocessing algorithm and at least one inspection parameter recommendedby an expert with respect to each kind of the object.
 10. Theprogramming apparatus in accordance with claim 1, wherein the standardflow memory stores a combination of a standard inspection flow, aplurality of image processing algorithms and at least one inspectionparameter, precedence being given to the image processing algorithmrecommended by an expert with respect to each kind of the object. 11.The programming apparatus in accordance with claim 1, wherein thestandard flow memory stores a combination of a standard inspection flow,at least one image processing algorithm and a plurality of inspectionparameters, precedence being given to the inspection parametersrecommended by an expert with respect to each kind of the object. 12.The programming apparatus in accordance with claim 1, wherein thestandard flow memory stores an initial value of each inspectionparameter, a width and directions for changing the value of eachinspection parameter, and an upper limit and a lower limit of a regionwithin which the value of each inspection parameter is varied.
 13. Theprogramming apparatus in accordance with claim 1, wherein the inspectionprocessor compares the result of the visual inspection with respect toeach sample image data with defectiveness or non-defectiveness of thesample inspected in the visual inspection, counts a number of the resultof the inspection regarding the defectiveness or non-defectiveness ofthe sample, and repeats the visual inspection of the sample image datawith changing of the inspection parameter until the counted numberreaches to a predetermined value.
 14. The programming apparatus inaccordance with claim 1, the inspection processor repeatedly requiringthe changing of an inspection parameter until the counted number reachesa predetermined value.
 15. The programming apparatus in accordance withclaim 1, wherein the inspection processor further displays at least oneimage using a sample image data on the monitor display of the displayunit.
 16. The programming apparatus in accordance with claim 15, whereina region to be inspected on a surface of the object is selected bydefining at least two points by using the input unit while the image ofthe object is displayed on the monitor display of the display unit. 17.The programming apparatus in accordance with claim 15, wherein theinspection processor displays images before and after the imageprocessing of each sample image data on the monitor display of thedisplay unit.
 18. The programming apparatus in accordance with claim 1,wherein the inspection processor further displays a table that shows thevisual inspection results with respect to all the sample image data, onthe monitor display of the display unit.
 19. The programming apparatusin accordance with claim 18, wherein the inspection processor displaysimages before and after the image processing of a sample image data inthe table on the monitor display of the display unit when the userselects a point on the monitor display corresponding to the sample data.20. The programming apparatus in accordance with claim 1, furthercomprising a data communication unit for outputting the visualinspection program to an external visual inspection apparatus.
 21. Theprogramming apparatus in accordance with claim 1, further comprising arecording apparatus for recording the visual inspection program in arecording medium.
 22. The programming apparatus in accordance with claim1, further comprising an image acquisition apparatus that receives thesample image data.
 23. A visual inspection apparatus comprising an imageacquisition unit for taking an image data of an object conveyed on amanufacturing line; a visual inspection unit for performingpredetermined image processing to the image data taken by the imageacquisition unit and for judging whether an appearance of the object isdefective or non-defective by following a visual inspection program; aremover for removing the object or for instructing removal of the objectjudged defective from the manufacturing line; and a visual inspectionprogrammer for programming a visual inspection program suitable forinspecting the object, the visual inspection programming unit furthercomprising: an image data memory that stores a plurality of userprepared sample image data of defective units and non-defective units ofthe object to be inspected; an algorithm memory that stores a pluralityof image processing algorithms with respect to each inspection object; astandard flow memory that stores at least one standard inspection flowand a plurality of inspection parameters with respect to each kind ofthe object to be inspected; a display unit having a monitor display fordisplaying at least a guidance of programming steps; an input unitconfigured for inputting or selecting a kind of an object to beinspected, and for selecting at least one image processing algorithm andat least one inspection parameter; and an inspection processor fordisplaying the guidance of the programming steps, automaticallyselecting a standard inspection flow from the standard flow memorycorresponding to the input or selection of the kind of the object,reading at least one image processing algorithm from the algorithmmemory and at least one inspection parameter from the standard flowmemory corresponding to the input or selection, programming aprovisional visual inspection program by using the standard inspectionflow, at least one image processing algorithm and at least oneinspection parameter, processing the sample image data of defectiveunits and non-defective units by following the provisional visualinspection program, executing the visual inspection to determine whetheran appearance of the object with respect to each sample image data isdefective or non-defective using processed image data, displayingresults of the visual inspection of the sample image data on the monitordisplay of the display unit, requiring a judgment whether theprovisional visual inspection program is proper or improper, andoutputting the provisional visual inspection program as a final visualinspection program upon a judgment that the provisional visualinspection program is proper.
 24. A method for performing a visualinspection program comprising: storing a plurality of image processingalgorithm with respect to each inspection object, at least one standardinspection flow and a plurality of inspection parameters with respect toeach kind of object to be inspected; requiring input or selection of akind of the object to be inspected; requiring input of a plurality ofsample image data of defective units and non-defective units of theobject to be inspected; automatically selecting a standard inspectionflow corresponding to the kind of the object among the previously storedstandard inspection flows; requiring selection of at least one imageprocessing algorithm and at least one inspection parameter of the storedimage processing algorithms and the inspection parameters by followingthe selected standard inspection flow; programming a provisional visualinspection program using the selected standard inspection flow, theimage processing algorithm and the inspection parameter; reading out thesample image data sequentially; executing visual inspection of thesample image data by following the provisional visual inspectionprogram; executing the visual inspection with respect to each sampleimage data to judge whether an appearance of the object is defective ornon-defective; and displaying the result of the judgment of the visualinspection of the sample image data on a monitor display.
 25. A programstored on a computer readable medium for programming a visual inspectionprogram, the program comprising the: requiring user input or selectionof a kind of an object to be inspected; automatically selecting astandard inspection flow from a previously input plurality of standardinspection flows corresponding to the input or selection of the kind ofthe object; requiring input of a plurality of sample image data of theobject including at least one defective unit and at least onenon-defective unit; requiring selection of at least one image processingalgorithm and at least one inspection parameter of a plurality of imageprocessing algorithms and a plurality of inspection parameters;programming a provisional visual inspection program using the selectedstandard inspection flow, the image processing algorithm and theinspection parameter; reading the sample image data sequentially;executing the visual inspection with each sample image data inaccordance with the provisional visual inspection program; judgingwhether the sample image data is defective or non-defective; anddisplaying the result of the judgment with respect to all the sampleimage data on a monitor display.
 26. A computer readable recordingmedium storing at least one standard inspection flow with respect toeach kind of object to be inspected, a plurality of image processingalgorithms with respect to each inspection object, a plurality ofinspection parameters and a program for programming a visual inspectionprogram, wherein the program comprises: requiring user input or aselection of a kind of object to be inspected; requiring input of aplurality of previously prepared sample image data of defective unitsand non-defective units of objects to be inspected; automaticallyselecting a standard inspection flow corresponding to the kind of theobject from the stored standard inspection flows; requiring selection ofat least one image processing algorithm and at least one inspectionparameter from the stored image processing algorithms and the inspectionparameters in accordance with the selected standard inspection flow;programming a provisional visual inspection program using the selectedstandard inspection flow, the image processing algorithm and theinspection parameter; sequentially reading out the sample image data forexecuting visual inspection by following a provisional visual inspectionprogram configured by the selected standard inspection flow, imageprocessing algorithm and inspection parameter; executing the visualinspection with respect to each sample image data and judging whether anappearance of the object is defective or non-defective in accordancewith the provisional visual inspection program; and displaying theresult of the judgment of the visual inspection of the sample image dataon a monitor display.